package club.info.mongo.pojo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Collection;
import java.util.LinkedHashSet;

@Document
@Data
public class Person {

    @Id
    private String id;
    private String name;
    private Integer age;

    @Field("locs")
    private Collection<Location> locations = new LinkedHashSet<>();
}
